import { Web3, ethereum } from '/home/ftw/myvue/fl-front/node_modules/web3/dist/web3.min.js'

export function getWeb3(addr) {
    if (window.ethereum) {
        //连接到Metamask
        return new Web3(ethereum);
    } else {
        ///连接到Ganache
        return new this.Web3(
            new Web3.providers.HttpProvider(addr)
        );
    }
}